home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / rexx / arexx / speak2.lzh / speak.doc next >
Text File  |  1990-03-08  |  3KB  |  113 lines

  1. Here's a simple ARexx to Narrator translator.
  2.  
  3.  
  4. Completely public domain, written by Rick Morris, Victoria AmUser's group.
  5. No warranties, etc.  Use at your own risk.  Pass it around anywhere you
  6. wish.
  7.  
  8. Based on the library example RXEXAMPLE given on the ARexx distribution
  9. disk, which is (c) Bill Hawes.
  10.  
  11.  
  12. It is called translib.library, and MUST be moved to your libs:  directory.
  13. Use the ARexx statement
  14.               call addlib('translib.library',0,-30,0)
  15. to add it into the system list.
  16.  
  17. It contains 2 new functions, XLATE() and SPEAK().
  18.  
  19.  
  20. XLATE()
  21.  
  22. Translates the given string into phoenemes.  A maximum of 512 characters
  23. will be generated.  A non-zero value in the special variable RESULT
  24. indicates an error occurred.  If RESULT is ~= 0, then its absolute value is
  25. the offset (in characters) from the beginning of the input string where the
  26. error occurred.  Note the only error that will occur is buffer overflow.
  27. See the autodocs on the Translator.device for more info.
  28.  
  29. Example:
  30.  
  31. temp = xlate(hello)
  32. say temp                ========>  /HEH4LOW
  33.  
  34.  
  35. SPEAK()
  36.  
  37. Uses the narator device to talk.  All of the options below are adjustable.
  38. See the table below for defaults, and maxium and minimum values.  Error
  39. checking is done on these.
  40.  
  41. OPTIONS:
  42. SPEAK(STRING,RATE,MODE,PITCH,SEX,VOLUME,SAMPFREQ)
  43.  
  44. All of these are optional, except the STRING argument which MUST be a valid
  45. phoeneme string.
  46.  
  47.  
  48. len = SPEAK("/HEH4LOW",200,1,90,1,32,15000)
  49.  
  50. ------------------------------------^  sample frequency, a bit slow (wierd)
  51. ---------------------------------^  volume, half
  52. -------------------------------^  sex, female
  53. ----------------------------^  pitch, a bit low
  54. --------------------------^  mode, robotic
  55. ----------------------^ rate, a bit fast
  56. ------------^  the string
  57.  
  58. Errors are checked for in this function (mostly by the narrator.device) and
  59. can be detected by the routine returning other that 512 (the length of the
  60. internal buffer).  The number returned is the number of characters of
  61. STRING that were succesfully spoken and the global variable RESULT contains
  62. an error message.  Try it out, you'll get the idea.
  63.  
  64. NOTE:  If you CALL speak(), as in CALL SPEAK(STRING), then the variable
  65. RESULT will contain the number of characters spoken, and NOT the error
  66. string.  This is the way ARexx works.....  the CALL instruction sets the
  67. variable RESULT itself, after I set it from within the library.
  68.  
  69. Here are a list of defaults, and minimum and maximum values.
  70.  
  71.  
  72. DEFAULTS
  73.  
  74. Option                         Value
  75.  
  76. Pitch                110
  77. Rate                150
  78. Natural F0 Contour        0
  79. Sex (Male)            0
  80. Volume (FULL)            64
  81. Sampling Frequency         22200
  82.  
  83. PARAMETER BOUNDS
  84.  
  85. Minimum Speaking Rate        40
  86. Maximum Speaking Rate        400
  87.  
  88. Mode Natural            0
  89. Mode Robotic            1
  90.  
  91. Minimum Pitch            65
  92. Maximum Pitch            320
  93.  
  94. Sex Male            0
  95. Sex Female            1
  96.  
  97. Minimum Volume            0
  98. Maximum Volume            64
  99.  
  100. Minimum Sampling Frequency    5000
  101. Maximum Sampling Frequency    28000
  102.  
  103.  
  104. Bug reports to:
  105.  
  106.  
  107. Rick Morris
  108. 5051 Benton Court
  109. Victoria, B.C.
  110. 658-2900
  111.  
  112. AmUser's Place ID Rick
  113.